<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/common.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
	<title>角色管理页面</title>

	<link href="${prcs}/css/def/ztree/metro.css" rel="stylesheet">
	<link href="${prcs}/css/def/bootstrap/ace/ace-part2.min.css" rel="stylesheet">
    <link href="${prcs}/css/def/bootstrap/ace/ace.css" rel="stylesheet">
    <link href="${prcs}/css/def/bootstrap/ace/ace-ie.min.css" rel="stylesheet">
	<link href="${prcs}/css/def/frm/common/common.css" rel="stylesheet">
	<script src="${prcs}/js/jquery/plugin/jquery.ztree.all-3.5.min.js"></script>
	<style>
		table td {
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
			text-align: center;
			font-size: 13px !important;
		}
		table th {
			text-align: center;
			font-size: 13px !important;
		}
		.roleChoose {
			padding:8px;
		}
</style>
	<script type="text/javascript">
		var hadPermission = {'update':false,'del':false,'getPerm':false,'getStaff':false};
		<shiro:hasPermission name="sys:role:update">
		hadPermission.update =true;
		</shiro:hasPermission>
		   <shiro:hasPermission name="sys:role:delete">
		hadPermission.del = true;
		</shiro:hasPermission>
		<shiro:hasPermission name="sys:role:getPerm">
		hadPermission.getPerm = true;
		</shiro:hasPermission>
		<shiro:hasPermission name="sys:role:getStaff">
		hadPermission.getStaff = true;
		</shiro:hasPermission>	
	</script>

</head>
<body style="background-color:#fff;">
<div class="head-title" id="roleManage">
	<span>角色管理</span>
</div>
<div class="body">
<!-- 主页面展示 -->
<div class="container-fluid" id="searchContent">
	<div class="row">
		<form class="form-inline form-left" method="post" id="sysRoleForm">
			<div class="input-group col-md-3 free-3" style="margin-right:20px;">
		        <label class="input-group-addon" for="sysRoleName" >角色名</label>
				<input type="text" class="form-control" name="sysRoleName"  size="30px" id="sysRoleName"  maxlength="20">
			</div>
			<div class="div-button col-md-pull-3">
			    <a type="button" class="btn btn-info" onclick="searchRole()"><i class="ace-icon glyphicon glyphicon-search"></i>查询</a>
			    <a type="button" class="btn btn-info" onclick="reset()"><i class="ace-icon glyphicon glyphicon-repeat"></i>重置</a>
			    <shiro:hasPermission name="sys:role:add">
			    <a type="button" class="btn btn-success" onclick="addRoleShow()"><i class="ace-icon glyphicon glyphicon-plus align-top bigger-125"></i>新增</a>
				</shiro:hasPermission>
			</div>
		</form>
	 </div>
	<hr>
	<div class="row">
		<table id="searchTable" class="display table table-bordered" cellspacing="0" width="100%">
			<thead>
				<tr>
					<th>操作</th>
					<th>角色名</th>
					<th>角色描述</th>
					<th>添加时间</th>
				</tr>
			</thead>
		</table>
	</div>
</div>
<!-- 主页面展示结束 -->

<!-- 新增/删除模态框 开始 -->

<div class="container-fluid staffUpdate" id="roleModal" style="display:none;">
	<div class="orderchek-body-row">
		<form  class="form-horizontal" role="form" id="roleForm">
			<div class="orderchek-border">
	        <div id="roleModalTitle" class="orderchek-title"></div>
				<div class="ordercheck-table table-responsive">
					<div class="demo-row modal-body" id="roleField" >
						<input type="hidden" name="id" id="roleId" >
                        <input type="hidden" name="orgId" id="orgId" >
						<div class="form-group">
							<div class="input-group">
								<label for="name" class="input-group-addon">角色名称<span class="notNull">*</span></label>
				      			<input type="text" class="form-control" name="roleName" id="roleName" placeholder="角色名称"  maxlength="20">
				  			</div>
				 	 	</div>
				  		<div class="form-group">
				  			<div class="input-group">
				    			<label class="input-group-addon">角色描述<span class="notNull">*</span></label>
			      				<input type="text" class="form-control" name="roleDesc" placeholder="角色描述" id="roleDesc">
				    		</div>
				  		</div>
				  		<div class="form-group">
				  			<div class="input-group">
				    			<label class="input-group-addon" style="vertical-align: top;">角色权限</label>
			    				<ul id="permissionTree" class="ztree" style="width:560px; overflow:auto;"></ul>
			    			</div>
			    		</div>
			    		<div class="form-group" id="permForPermManage" style="display:none;">
				  			<div class="input-group">
				    			<label class="input-group-addon" style="vertical-align: top;">权限管理可操作的权限</label>
			    				<ul id="permForPermManageTree" class="ztree" style="width:560px; overflow:auto;"></ul>
			    			</div>
			    		</div>
			    		<div class="form-group" id="roleForRoleManage" style="display:none;">
				  			<div class="input-group" id="roleList">
				    			<label class="input-group-addon" style="vertical-align: top;">角色管理可操作的角色</label>
								
			    			</div>
			    		</div>
			    		<div align="center">
			       			<button type="submit" class="btn btn-primary ma_btn2" name="addBtnName" style="display:none" id="addBtn">保存</button>
							<button type="submit" class="btn btn-primary ma_btn3" style="display:none" id="updateBtn">修改</button>
							<button type="button" class="btn btn-primary"  onclick="backSearch1();">返回</button>
			      		</div>
			    	</div>
			</div>
			</div>
		</form>
	</div>
</div>
<!-- 新增/删除模态框 结束 -->

<!-- 角色人员查看 -->
<div class="container-fluid" id="RoleContainer" style="display:none;">
	<input type="hidden" id="showStaffInRoleId" value="">
	<div class="ma_tip" style="margin:-10px 0 0px -15px;font-size:16px; color:#ca5952;"></div>
	<div class="row">
		<div class="float-btn">
		<a type="button" class="btn btn-info" id="AddStaffInRoleModal" onclick="selectStaff();">新增</a>
			<a type="button" class="btn btn-info" id="closeAddModal" onclick="backSearch1();">返回</a>
		</div>
	</div>
		<hr>
	<div class="row">
		<!-- 列表 -->
		<table id="searchStaffTable" class="display table table-bordered" style="width:100%">
			<thead>
				<tr>
                    <th>&nbsp;</th>
					<th>人员姓名</th>
					<th>账号</th>
					<th>岗位</th>
					<th>性别</th>
					<th>电话号码</th>
					<th>邮箱账号</th>
					<th>手机号码</th>
					<th>岗位状态</th>
					<th>操作</th>
				</tr>
			</thead>
			</table>
		</div>
	</div>
</div>
<!-- 查看角色拥有权限 开始-->
<div class="modal fade" id="roleHavepermModal" tabindex="-1" role="dialog">
	<div class="orderchek-body" style="width: 700px;height: 400px;margin-left: -350px;margin-top: -200px;">
		<div class="orderchek-border">
			<div class="orderchek-title" class="modal-title" id="permModalLabel" style="width:auto;">该角色拥有的权限</div>
			<div class="modal-body" style=" height:290px; overflow:auto;margin:11px 0;">
				<ul id="permissionTree1" class="ztree" ></ul>
			</div>
			<div align="center">
				<button type="button" class="btn btn-primary"  data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
</div>

<!-- 人员信息模态框 开始 -->
	<div class="modal fade" id="infoModal" tabindex="-1" role="dialog" aria-labelledby="infoModal_label">
		<div class="modal-dialog" style="min-width: 800px;">
			<div class="modal-content">
	            <div class="modal-header">
	                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
	                    <span aria-hidden="true">&times;</span>
	                </button>
	                <h4 class="modal-title">人员基本信息</h4>
	            </div>
				<div>
					<iframe id="jump_url" width="100%" height="100%" src="" style="min-height: 360px;"></iframe>
				</div>
				<div class="modal-footer">
					<button type="button"class="btn btn-primary"  data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
<!-- 人员信息模态框 结束 -->

	<!-- 人员选择开始 -->
	<div class="modal fade" id="staffModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">人员选择</h4>
                <span id='jinggao' style='color:red;'></span>
            </div>
				<div class="modal-body" style="max-height: 460px;overflow-y: scroll;">
 					<!-- <input type="checkbox" id="linkBranch" onclick="Branch()">是否关联下级 -->
					<ul id="stafftree" class="ztree"></ul>
				</div>
				<div class="modal-footer"> 
            <center><button onclick="getStaffCheck()" class="btn btn-info">确 定</button></center>
        </div> 
				<!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
</div>
	<!-- 人员选择结束 -->


</body>
<script src="${prcs}/js/frm/sys/sysRole1.js"></script>

</html>
